package training.threads;

public class MyThread extends Thread {
	
	private volatile int id;
	//Each thread will have its own local localId attribute when we use ThreadLocal
	ThreadLocal<Integer> localId = new ThreadLocal<Integer>();
	
	public MyThread(int id){
		this.id =id;
		
	}
	
	@Override
	public void run(){
		
		for(int i=0; i < 10; i++){
			System.out.println("Thread : " + id + "  printing :" + i);
			
			try {
				Thread.sleep(100);
				//id= i;
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		
	}
	
	

}
